package com.linked.basemanage.permissioncontrol.service.impl;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.linked.basemanage.permissioncontrol.bean.param.AddMenusToPowerParam;
import com.linked.basemanage.permissioncontrol.bean.po.PowerInfoPO;
import com.linked.basemanage.permissioncontrol.mapper.IPowerInfoMapper;
import com.linked.basemanage.permissioncontrol.service.IPowerInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author :dbq
 * @date : 2023/2/22 14:32
 * @description : desc
 */
@Service
@Slf4j
public class PowerInfoServiceImpl implements IPowerInfoService {

    private final ObjectMapper mapper;

    private final IPowerInfoMapper powerInfoMapper;

    @Autowired
    public PowerInfoServiceImpl(ObjectMapper mapper, IPowerInfoMapper powerInfoMapper) {
        this.mapper = mapper;
        this.powerInfoMapper = powerInfoMapper;
    }

    @Override
    public boolean addPower(PowerInfoPO param) throws Exception {
        return powerInfoMapper.insert(param) > 0;
    }

}
